<template>
  <div>
    <van-nav-bar
        title="我的收藏"
        left-text="返回"
        left-arrow
        fixed
        @click-left="onClickLeft"
    />
  </div>
  <!--  我的发布房源-->
  <div class="kkkkk">
  <van-list class="list">
<!--      v-model:loading="loading"-->
<!--      :finished="finished"-->
<!--      finished-text="没有更多了"-->
<!--      @load="onLoad"-->
<!--  >-->
    <van-cell v-for="item in rents" :key="item.picture" class="van"  >
      <div class="publish">
        <!--    图片-->
        <div class="fang">
          <div class="imag">
          <van-image
              width="100"
              height="100"
              :src="item.picture"
          />
          </div>
          <!--      房子位子-->
          <div class="address">
            <h4>{{item.address}}</h4>
          </div>
          <!--      介绍-->
          <div class="jie">
            <span class="hj">{{item.houseArea}}平方 {{item.houseStar}}</span>
          </div>
          <!--      价格-->
          <div class="jiage">
            <h5>{{item.houseRent}}元/月</h5>
          </div>
        </div>
      </div>
    </van-cell>
  </van-list>
  </div>
</template>

<script setup>
//点击进来钩子函数查询并赋值
import {ref ,onMounted} from 'vue';
import {get,post} from '../../util/request.js'
import {useStore} from '../../pinia/index.js'
import axios from "axios";
const store=useStore()
const rent =ref({})
const rents=ref([])
const loading = ref(false);
const finished = ref(false);
//test 钩子函数
onMounted(()=>{
  axios({
    method:'get',
    url:"http://39.106.55.36:9099/my/collect",
  }).then((res) => {
    rents.value=res.data.data
    console.log(rents)
    // rent.value=(res.data.data)
  }).catch((err)=>{
    // console.log("((((((((((((((")
  })
})
//xia  jia
// dId.value=rent.value.id
// const deleteOne = () => {
//
//   console.log(rent.value.id)
//   axios({
//     method:'get',
//     url:"http://localhost:9099/my/deleteOne",
//     params:{
//       id:rent.value.id
//     }
//   }).then((res) => {
//     rent.value=(res.data.data)
//   }).catch((err)=>{
//     console.log("((((((((((((((")
//   })
//
// }
const onClickLeft = () => history.back();
//d点击跳到发布界面
import {useRouter} from "vue-router";

const router = useRouter();
const iss = () => {
  router.push("/issue")
}
</script>

<style scoped>
.kkkkk{
  position: absolute;
  top: 1px;
  left: 1px;
  background-color: #e9e7e7;
  width: 429px;
  height: 800px;

}
.imag{
  position: absolute;
  width: 100px;
  height: 100px;
  top: 0;
  left: 0;

}
.van{
  width: 400px;
  height: 155px;
  margin-top: 35px;
  margin-bottom: -39px;
  --van-cell-background:#e9e7e7;
}
.list{
  position: absolute;
  top: 10px;
  left: 14px;
  width: 400px;
  height: auto;
margin-top: -33px;
}
/*我的发布*/
.publish {
  position: absolute;
  top: 31px;
  left: 8px;
  width: 358px;
  height: 100px;
  background-color: white;
  border: 1px solid black;
  border-radius: 5px;
}
.fang{
  margin-left: -299px;
}
.address{
  position: absolute;
  top: 0px;
  left: 101px;
  width: 247px;
  text-align: left;

}
.jie{
  position: absolute;
  top: 74px;
  left: 109px;
  width: 214px;
  text-align: left;
}
.jiage{
  position: absolute;
  top: 76px;
  left: 271px;
  width: 75px;
}

.hj{
  color: #9d9d9d;
}

h4{
  margin: auto;
}
h5{
  margin: auto;
}
h3 {
  color: #dbd3d3;
  margin: auto;
}
p{
  margin: auto;
  color: #ab2626;
}
</style>
